<template>
  <div class="mask-box" @click="closeHandle()">
    <div class="pass-box">
      <div class="round-m">
        <img src="/static/Prompt.png" alt="">
      </div>
      <!-- <img class="default-img" src="/static/outEnergy.png"> -->
      <!-- <img class="close" src="/static/close.png" @click="closeHandle"> -->

      <div class="title">{{config.energyTitle}}</div>

      <!-- <div class="table">
        <div class="tr">
          <div class="td">充值{{sysConfig.baseEnergyCost}}元</div>
          <div class="td">
            <img src="/static/energy.png" alt=""> 回满
          </div>
        </div>
        <div class="tr">
          <div class="td">分享并让好友点击分享卡片</div>
          <div class="td">
            <img src="/static/energy.png" alt=""> X30
          </div>
        </div>
        <div class="tr">
          <div class="td">每{{formateMin}}分钟回复</div>
          <div class="td">
            <img src="/static/energy.png" alt=""> X1
          </div>
        </div>
      </div> -->

      <div class="btn-box">
        <!-- <div class="btn-left" @click="leftClickHandle">确认付款</div> -->
        <!-- <button plain="true" class="btn-right" @click="rightClickHandle" open-type="share">马上分享</button> -->
        <!-- <div class="btn-right" @click="rightClickHandle">马上分享</div> -->
      </div>
    </div>
  </div>
</template>

<script>
// 过关弹窗 三种类型 图文 图片需要传参，其他两个 默认
import { mapState, mapMutations } from "vuex";
export default {
  data() {
    return {
      config: {
        title: "直接跳过本关",
        desc: "是否花费1元直接跳过本关",
        energyTitle: "金币不足啦, 求助可获得更多金币",
        energyDesc: "是否花费5元回满体力",
        addEnergyTitle: "补充体力",
        addEnergyDesc: "是否花费5元回满体力"
      }
    };
  },
  computed: {
    ...mapState(["sysConfig"]),
    formateMin(){
        return (this.sysConfig.baseTime/60)
    },
  },
  methods: {
    leftClickHandle() {
      this.$emit("leftClick");
    },
    rightClickHandle() {
      this.$emit("rightClick");
    },
    closeHandle() {
      this.$emit("close");
    },
    closeTime(event) {
      // console.log(event);
      // let we = this.event;
      // console.log(we);
      // setTimeout(() => {
      // }, 100);
    }
  },
  mounted() {
    setTimeout(() => {
      this.closeHandle();
    }, 1500);
    // console.log(this.closeTime());
  }
};
</script>

<style lang="scss" scoped>
.table,.tr,.td{
  display: flex;
  justify-content: center;
  align-items: center;
  align-items: stretch;
}
.table{
  width: 470rpx;
  margin: 0 auto 32rpx;
  flex-wrap: wrap;
  border: 2rpx solid #d6d6d6;
  border-bottom: 0;
  color: #949191;
}
.tr{
  .td{
    flex-wrap: wrap;
    width: 230rpx;
    padding: 12rpx 30rpx;
    box-sizing: border-box;
    line-height: 1.5em;
    align-items: center;
    font-size: 28rpx;
    border-bottom: 2rpx solid #d6d6d6;
    border-left: 2rpx solid #d6d6d6;
    &:nth-of-type(2n+1){
      border-left: 0;
    }
    img{
      width: 56rpx;
      height: 56rpx;
      margin-right: 6rpx;
    }
  }
}
.mask-box {
  position: absolute;
  top:  -95rpx;
  left:-325rpx;
  width: auto;
  height: auto;

}

.pass-box {
  width: 500rpx;
  height: 70rpx;
  background-color: #fff;
  border-radius: 30rpx;
  animation-name: entering;
  animation-duration: 0.3s;
  filter: drop-shadow(0 0 10rpx rgba(0,0,0,.5));
  &:after {
    position: absolute;
    content: "";
    // background-color: #000;
    right: 20rpx;
    bottom: -20rpx;
    width: 0;
    height: 0;
    border-left: 30rpx solid transparent;
    border-right: 30rpx solid transparent;
    border-top: 30rpx solid #fff;
    z-index: 1;
  }
}

.round-m {
  position: absolute;
  top: -10rpx;
  left: -10rpx;
  img {
    width: 100rpx;
    height: 100rpx;
  }
}


.default-img,
.img-box {
  width: 260rpx;
  height: 260rpx;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -84rpx;
}
.img-box {
  width: 240rpx;
  height: 240rpx;
  top: -74rpx;
  border-radius: 50%;
  overflow: hidden;
  img {
    position: absolute;
    left: 50%;
    top: 50%;
    // transform: translate(-50%, -50%);
  }
}
.title {
  position: absolute;
  top: 0;
  right: 25rpx;
  line-height: 1.5rpx;
  font-size: 26rpx;
  padding:40rpx 0 32rpx 60rpx;
  text-align: center;
  color: #e55f80;
}
.desc {
  font-size: 30rpx;
  line-height: 1.4em;
  color: #aaaaaa;
  margin-bottom: 42rpx;
}
.btn-left,
.btn-right {
  width: 170rpx;
  height: 62rpx;
  font-size: 30rpx;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3rpx solid #e55f80!important;
  color: #e55f80;
  border-radius: 4rpx;
  background: #e55f80;
  padding: 0;
}
.btn-left {
  background: transparent;
  margin-right: 28rpx;
}
.btn-right {
  color: #fff;
  height: 66rpx;
  margin: 0;
}
.close {
  position: absolute;
  right: 20rpx;
  top: 20rpx;
  width: 48rpx;
  height: 48rpx;
}
@keyframes entering {
    0%   {opacity: 0.1}
    50%  {opacity: 0.8}
    75%  {opacity: 0.9}
    100% {opacity: 1}
}

</style>
